<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="h" uri="/syzg-html"%>

<!DOCTYPE html>
<html>
<head>
		<%@ include file="/base/jsp/common/CommonListTop.jsp"%>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>[菜单名(或大模块名)-模块名]</title>
		<link href="${ctx}/base/css/common.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/base/css/${customTheme}.css" rel="stylesheet" type="text/css" />
		<script src="${ctx}/base/js/base.js" type="text/javascript"></script>
		<script src="${ctx}/base/js/common/FormFunction.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/plugins/jQuery/jQuery-2.2.0.min.js"></script>
		<link href="${ctx}/baseNew/bootstrap/css/bootstrap.min.css" rel="stylesheet">
		<script src="${ctx}/baseNew/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    	<link href="${ctx}/baseNew/other/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
		<script src="${ctx}/baseNew/other/js/bootstrap-datetimepicker.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/other/js/locales/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
		<link rel="stylesheet" href="${ctx}/baseNew/dist/css/AdminLTE.min.css">
  		<script src="${ctx}/baseNew/other/js/bootbox.min.js" type="text/javascript"></script>
  		<link rel="stylesheet" href="${ctx}/baseNew/validator/css/bootstrapValidator.css"/>
		<script type="text/javascript" src="${ctx}/baseNew/validator/js/bootstrapValidator.js"></script>
		<!-- 公用的按钮函数 -->
		<script>
			var viewUrl = "${ctx}/path/specialnews/viewNewsinfo";//表单列表view的url地址
			var listUrl = "${ctx}/path/specialnews/listNewsinfo";//表单列表list 的url地址,用来作为搜索地址
 
			function submit() {
				var $from = $("#searchForm");
				$from.action = listUrl;
				$from.submit();
			}
			
			$(document).ready(function() {
			    var selectedNews = parent.document.getElementById("selectedNews").value;
				if(selectedNews){
					var selectedArray = selectedNews.split(",");
				    $("input[type=checkbox][name=selectedRow]").each(function(i,v){
					    var val = $(v).prop("value");
					    for(var count=0; count<selectedArray.length; count++){
						    if(selectedArray[count] && val == selectedArray[count]){
							    $(v).prop("checked", true);
							    break;
						    }
					    }
				    });
				}
		    });
		</script>
	</head>
	<body class="rightBody">
		<form name="searchForm" method="post" id="searchForm" action="" class="form-inline">
			<table width="100%" class="title" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td>
					  <label class="control-label sr-only" for="searchValue_'title'_">Email address</label>
					  <input type="text" name="title" id="searchValue_title"  placeholder="search..."/>
					  <input type="hidden" name="colId" value="${newsColId}">
					  <button type="button" class="" onclick="submit()">搜索</button>
				  </td>
				</tr>
			</table>
			<div style="height: 350px;">
			<h:table cssClass="table table-bordered table-hover table-striped" cssStyle="margin-bottom:-5px;">
				<h:column headerTitle="选择" align="center" width="50" cssDStyle="padding:4px;">
					<input type="checkbox" name="selectedRow" value="${o.id }" onclick="parent.checkNews(this,'${o.title}');"/>
				</h:column>
				
				<!-- generate code start -->

                <h:column headerTitle="新闻标题" width="250" cssHStyle="font-size:12px;" cssDStyle="font-size:12px;padding:4px;">
                	<a href="javascript:FormFunction.showViewModal('${o.id}');">${o.title}</a>
                </h:column>

                <h:column headerTitle="所属栏目" cssHStyle="font-size:12px;" cssDStyle="font-size:12px;padding:4px;">
                    ${o.newsColumns.name}
                </h:column>
                
                <h:column headerTitle="创建时间" width="130" cssHStyle="font-size:12px;" cssDStyle="font-size:12px;padding:4px;">
                    <fmt:formatDate value="${o.createTime}" pattern="yyyy-MM-dd HH:mm"/> 
                </h:column>
			</h:table>
			</div>
			<!-- <table width="100%" class="pageDown" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="right">
						<h:pager cssStyle="font-size:12px;margin:0px;"/> &nbsp;
					</td>
				</tr>
			</table>  -->
		</form>
		<%@ include file="/base/jsp/common/CommonListFoot.jsp"%>
	</body>
</html>
